package com.bjsxt.livegoods.buyaction.service.config;

import com.bjsxt.livegoods.dao.order.OrderDao;
import com.bjsxt.livegoods.dao.order.OrderDaoImpl;
import com.bjsxt.livegoods.dao.product.ProductDao;
import com.bjsxt.livegoods.dao.product.ProductDaoImpl;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;

@Configuration
public class BuyactionConfiguration {

    @Bean
    public ProductDao productDao(MongoTemplate mongoTemplate){
        ProductDaoImpl dao=new ProductDaoImpl();
        dao.setMongoTemplate(mongoTemplate);
        return dao;
    }
    @Bean
    public OrderDao orderDao(MongoTemplate mongoTemplate){
        OrderDaoImpl dao=new OrderDaoImpl();
        dao.setMongoTemplate(mongoTemplate);
        return dao;
    }

//    @Bean
//    public LivegoodsMessagePublisher
//    livegoodsMessagePublisher(AmqpTemplate amqpTemplate){
//        LivegoodsMessagePublisher messagePublisher = new
//                LivegoodsMessagePublisher();
//        messagePublisher.setAmqpTemplate(amqpTemplate);
//        return messagePublisher;
//    }
}
